package com.romadan.core.nonlinearanalys.fet.angelov;

import java.util.List;
import java.util.Map;

import com.romadan.core.linearanalys.logic.LParameters;
import com.romadan.core.nonlinearanalys.NonlinearModelAbstract;
import com.romadan.core.nonlinearanalys.fet.logic.SimulationPoint;
import com.romadan.core.wolfram.WolframPerfomer;
import com.romadan.core.wolfram.utils.Utils;
import com.wolfram.jlink.Expr;

public class TransistorModel extends NonlinearModelAbstract {

	public TransistorModel(List<LParameters> listLParameters) {
		super(listLParameters);
		wtm = new WolframTransistorModel();
		utils = new Utils();
		inputListGm = super.getGmFromLParams();
	}

	private WolframTransistorModel wtm = null;
	private Utils utils = null;
	private List<SimulationPoint> inputListGm = null;

	@Override
	public List<String> getParamsName() {
		return utils.convertFromWolframArrayToList(wtm
				.getModelAngelovParameters());
	}

	@Override
	public Map<String, Double> getParamsValue() {
		// TODO Plugs!!!

		String wolframArrayGm = utils.convertToWolframArrayOfVgs(inputListGm);
		Double dVds=inputListGm.get(0).getVds();

		Expr dataList = new Expr(wolframArrayGm);
		Expr VdsValue = new Expr(dVds);
		
		Expr eValues = wtm.getParamForAngelov(dataList, VdsValue);
		wtm.close();

		
		return utils.convertFromRuleToMapDouble(eValues.toString());
	}

	@Override
	public List<SimulationPoint> getCurrent() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<SimulationPoint> getGm(int order) {
		// TODO Auto-generated method stub
		return null;
	}

}
